﻿using System.Collections.Generic;

namespace JTLeigh.Commerce.Spencer.Core.Business
{

    /// <summary>
    /// Represents the results of pagination.
    /// </summary>
    /// <typeparam name="T">The type of item being paginated.</typeparam>
    public class PaginationResult<T>
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="PaginationResult{T}"/> class
        /// </summary>
        /// <param name="currentPage">The current page number.</param>
        /// <param name="itemsOnCurrentPage">The <see cref="IList{T}"/> of items on the current page.</param>
        /// <param name="totalPages">The total number of pages.</param>
        public PaginationResult(int currentPage, IList<T> itemsOnCurrentPage, int totalPages)
        {
            CurrentPage = currentPage;
            ItemsOnCurrentPage = itemsOnCurrentPage;
            TotalPages = totalPages;
        }

        /// <summary>
        /// Gets or sets the current page number.
        /// </summary>
        public int CurrentPage { get; private set; }

        /// <summary>
        /// Gets or sets the list of items on the current page.
        /// </summary>
        public IList<T> ItemsOnCurrentPage { get; private set; }
        
        /// <summary>
        /// Gets the total number of pages.
        /// </summary>
        public int TotalPages { get; private set; }

    }

}
